import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

let state = {
	province: null, //省
	eara: null, //区
	city: null, //市
	num: null, //商品数量
	isshoucang:null,//商品详情用户收藏的状态
}
let mutations = {
	PROVINCE(state, data) {
		state.province = data
	},
	CITY(state, data) {
		state.city = data
	},
	EARA(state, data) {
		state.eara = data
	},
	NUM(state, data) {
		state.num = data
	},
	ISSHOUCANG(state, data) {
		state.isshoucang = data
	}
	
}
let actions = {
	province({
		commit
	}, data) {
		commit('PROVINCE', data)
	},
	city({
		commit
	}, data) {
		commit('CITY', data)
	},
	eara({
		commit
	}, data) {
		commit('EARA', data)
	},
	num({
		commit
	}, data) {
		commit('NUM', data)
	},
	isshoucang({commit},data) {
		commit('ISSHOUCANG', data)
	}
}
const store = new Vuex.Store({
	state,
	mutations,
	actions
})
export default store
